#ifndef _PARAMETER_INTERFACE_H
#define _PARAMETER_INTERFACE_H
#include <lib/cassert.h>
#include "parameter.h"

typedef struct interface_config {
	uint32_t magic;
	uint32_t version;
	uint32_t size;
	uint8_t rev1[4];

	uint8_t s3_flag_source;
    uint8_t qspi_speed_rank;
}__attribute__((aligned(sizeof(unsigned long)))) interface_config_t;

#define INTERFACE_MAGIC_OFFSET					0x0
#define INTERFACE_VERSION_OFFSET				0x4
#define INTERFACE_SIZE_OFFSET					0x8
#define S3_FLAG_SOURCE_OFFSET					0x10
#define QSPI_SPEED_RANK_OFFSET                  0x11

#define DEV_CASSERT( offset, _member)						\
	 CASSERT(offset ==										\
		 __builtin_offsetof(interface_config_t, _member),			\
		 assert_##_member##_mismatch)

DEV_CASSERT(INTERFACE_MAGIC_OFFSET, magic);
DEV_CASSERT(INTERFACE_MAGIC_OFFSET, magic);
DEV_CASSERT(INTERFACE_MAGIC_OFFSET, magic);
DEV_CASSERT(S3_FLAG_SOURCE_OFFSET, s3_flag_source);
DEV_CASSERT(QSPI_SPEED_RANK_OFFSET, qspi_speed_rank);

#endif

